package spring.j2024_11_17_2.wall.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import spring.j2024_11_17_2.wall.model.Message;
import spring.j2024_11_17_2.wall.service.MessageService;

import java.util.List;

@RequestMapping("/message")
@Controller
@ResponseBody
public class MessageController {
    @Autowired
    private MessageService service ;
    @RequestMapping("/put")
    public boolean put(Message message){
        return this.service.isPut(message);
    }
    @RequestMapping("/get")
    public List<Message> get(){
        return this.service.get() ;
    }
}
